<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>


<!DOCTYPE html>

<html>

<head>

    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">

    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

    <title>仪器共享</title>

    <meta name="keywords" content="科研仪器，生命科学仪器，环境检测仪器，实验常用设备，分析仪器">

    <meta name="description" content="中国领先的科研仪器共享平台，让您快速找到各种类型的科学研究仪器。提升闲置仪器利用率，产生更大科研价值。涵盖：生命科学仪器、环境检测仪器、实验常用设备、分析仪器、仪表、物性测试、测量/计量仪器、在线及过程控制仪器。

">
    <!--<link rel="stylesheet" href="new_css/header_footer.css?t=1">-->
    <link rel="stylesheet" href="new_css/lizisepuyi.css">
    <link rel="stylesheet" href="css/reset.css">
    <style>
        input {
            border: 1px solid #2222;
            border-radius: 5px;
        }
        select {
            border: 1px solid #2222;
            border-radius: 5px;
        }
        textarea {
            border: 1px solid #2222;
            border-radius: 5px;
        }
        .mainList .content .right .title{
            /*margin-left: 20px;*/
        }
        .minTitle {
            /*margin-left: 46px;*/
            border-left: 2px solid #ff8a00;
            padding-left: 10px;
            margin-top: 30px;
            font-size: 18px;
            /* font-family: MicrosoftYaHei; */
        }
        .mainList .content .right {
            width: 1178px;
            height: 100%;
            border: 1px solid #d3d3d3;
        }
        .mainList .content .right ul li label {
            width: 98px;
            display: inline-block;
            text-align: left;
            padding-right: 20px;
            /* margin-left: 40px; */
            padding-left: 53px;
        }
        textarea.taxtarea-haha {
            width: 961px;
            height: 306px;
        }
        .mainList .content .right button {
            width: 196px;
            height: 62px;
            text-align: center;
            line-height: 62px;
            background: #ff8a00;
            border: none;
            color: #fff;
            font-size: 26px;
            border-radius: 8px;
            -webkit-border-radius: 8px;
            -moz-border-radius: 8px;
            margin-left: 176px;
            margin-top: 20px;
        }
    </style>
    <script src="new_js/jquery-1.11.3.js"></script>
    <script>
        $(function() {
            $('#front_header .header_wrap .right').hover(function() {
                $('#front_header .header_wrap .right .main .icon img').attr('src', 'images/icon2.png');
                $('#front_header .header_wrap .right .out').show();
            }, function() {
                $('#front_header .header_wrap .right .main .icon img').attr('src', 'images/icon1.png');
                $('#front_header .header_wrap .right .out').hide();
            });
            $('#sorts').on('mouseover', 'li', function() {
                $(this).find('span img').attr('src', 'images/icon4.png');
            });
            $('#sorts').on('mouseout', 'li', function() {
                $(this).find('span img').attr('src', 'images/icon5.png');
            });

            $('.mainList .content .left li').click(function() {
                $(this).addClass('selected').siblings().removeClass('selected');
            });
        });
    </script>
    
    <script>
    	/* $(function(){
    		$.ajax({
    			type:"post",
     			url: "http://localhost/rel/ssi/disServOrder",
    			//url: Server + "/rel/ssi/disServOrder",
    			dataType: "JSON",
    			data:{
    				serviceId:${param.serviceId},
    				oid: ${param.oid},
    			},
    			success:function(data){
    			
    				$("#serviceName").val(data.ssiDo.serviceName);
    				$("#serviceAgency").val(data.ssiDo.serviceAgency);
    				$("#serviceFee").val(data.ssiDo.serviceFee);
    				$("#place").val(data.savePlace);
    				if(data.ssiDo!=null){
	    				$("#principal").val(data.ssiDo.contacts);
	    				$("#mobile").val(data.ssiDo.mobile);
	   					$("#address").val(data.ssiDo.address);
	   					$("#aTime").val(new Date(data.ssiDo.appointOrder.createTime).Format("yyyy-MM-dd"));
	   					$("#message").val(data.ssiDo.appointOrder.message);
    				}
    				
   					if(data.consumDO!=null){
	   					$("#realname").val(data.consumDO.realname);
	   					$("#unitName").val(data.consumDO.unitName);
	   					$("#amobile").val(data.consumDO.mobile);
   					}
    			}
    		});
    	}); */
    	$(document).ready(function(){
    		details();
	    	Date.prototype.Format = 
				function(fmt){
				var o = {
					"M+": this.getMonth() + 1, //月份 
	       			"d+": this.getDate(), //日 
	        		"h+": this.getHours(), //小时 
	        		"m+": this.getMinutes(), //分 
	        		"s+": this.getSeconds(), //秒 
	        		"q+": Math.floor((this.getMonth() + 3) / 3), //季度 
	        		"S": this.getMilliseconds() //毫秒 
				};
				if(/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
				for(var k in o)
				if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
	    		return fmt;
			}
			if(GetUrlByParamName("status")!=undefined && GetUrlByParamName("status")==2){
				$('#affirm').text("开始实验")	
			}
			$('#affirm').click(function(){
				var type = ${param.type};
				var uId = $('#useridoflogin').val();
				if(uId == ''){
					alert("请先登录后再进行此操作");
				}
				if(GetUrlByParamName("status")!=undefined && GetUrlByParamName("status")!==2){
					$.ajax({
						url :Server + "/orderRelevant/changeStatus",
						//url :"http://localhost/orderRelevant/changeStatus",
						data : {
							"id":${param.orderId},
							"status":3
						},
						type : "POST",
						//dataType: "JSON",
						success : function(data) {
							if(data=='修改成功'){
								alert("开始实验成功")
							}
							$(location).attr("href","book_admin26_1");
						},
					});	
				}else{
					$.ajax({
					//url:"http://localhost/user/sum/updateOrder",
					url:Server + "/user/sum/updateOrder",
					data:{
						orderId:${param.orderId},
					},
					type:"POST",
					success : function(data){
						if(data == 0){
							alert("该服务订单确认失败")
						}else{
							alert("确认成功")
							if(type == 2){
								$(location).attr("href","service_public24_1");
							}else if(type == 3){
								$(location).attr("href","book_admin26_1");
							}
						}
					},
					error : function(msg){
						alert("异常")
					}
				}) 
				}
				
			})
			
			function details(){
    		var type = ${param.type};
    		$.ajax({
    			//url:"http://localhost/user/sum/ssiDetails",
    			url:Server + "/user/sum/ssiDetails",
    			data:{
    				orderId:${param.orderId},
    			},
    			type:"POST",
    			dataType:"json",
    			success : function(data){
    				if(type == 1){
    					$('#affirm').hide();
    				}
    				$("#serviceName").val(data.serviceName);
    				$("#serviceAgency").val(data.serviceAgency);
    				$("#serviceFee").val(data.serviceFee);
    				$("#place").val(data.address);
    				$("#principal").val(data.contacts);
    				$("#mobile").val(data.mobile);
   					//$("#address").val(data.address);
   					$("#aTime").val(new Date(data.appointOrder.createTime).Format("yyyy-MM-dd"));
   					$("#message").val(data.appointOrder.message);
   					$("#realname").val(data.consum.realname);
   					$("#unitName").val(data.consum.unitName);
   					$("#amobile").val(data.consum.mobile);
    			}
    		})
    	}
			
    	})
    	
    	function GetUrlByParamName(name) {
  			 var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)");
 			 var URL =  decodeURI(window.location.search);
  			 var r = URL.substr(1).match(reg);
 			 if(r!=null){
 		        //decodeURI() 函数可对 encodeURI() 函数编码过的 URI 进行解码
 		         return decodeURI(r[2]);
  			 };
  		     return null;
 		};
    	
    </script>
    </head>
</head>
<body style="background:#fff;">

<%@include file="/header4.jsp"%>


<div class="mainList">
    <div class="bNav">您的位置：预约订单管理><span>服务订单详情</span></div>
    <div class="content">
        <div class="right">
            <div class="title"><span>服务订单详情</span></div>
            <div class="minTitle"><span>服务信息</span></div>

            <div class="form">
                <ul>
                    <li>
                        <label>服务名称</label>
                        <input type="text" name="" id="serviceName"  value="" readOnly="true"/>
                    </li>

                    <li>
                        <label>服务收费</label>
                        <input type="text" name="" id="serviceFee" value="" readOnly="true"/>
                    </li>
                    <li class="item4">
                        <label>服务负责人</label>
                        <input type="text" name="" id="principal"  value="" readOnly="true"/>
                    </li>
                    <!-- <li>
                        <label>地址</label>
                        <input type="text" name="" id="address"  value="" readOnly="true"/>
                    </li> -->

                </ul>

                <ul>
                    <li>
                        <label>服务机构</label>
                        <input type="text" name="" id="serviceAgency"  value="" readOnly="true"/>
                    </li>
                    <li>
                        <label>存放地点</label>
                        <input type="text" name="" id="place"  value="" readOnly="true"/>
                    </li>
                    <li>
                        <label>电话</label>
                        <input type="text" name="" id="mobile"  value="" readOnly="true" />
                    </li>
                </ul>
            </div>


            <div class="clearfix" >
                <hr style="border: 1px solid #efefef">
            </div>

            <div class="minTitle"><span>申请人信息</span></div>

            <div class="form">
                <ul>
                    <li>
                        <label>申请人</label>
                        <input type="text" name="" id="realname"  value="" readOnly="true"/>
                    </li>

                    <li>
                        <label>申请部门</label>
                        <input type="text" name="" id="unitName"  value="" readOnly="true"/>
                    </li>

                </ul>

                <ul>
                    <li>
                        <label>联系电话</label>
                        <input type="text" name="" id="amobile"  value="" readOnly="true"/>
                    </li>
                    <li>
                        <label>申请时间</label>
                        <input type="text" name="" id="aTime"  value="" readOnly="true"/>
                    </li>
                </ul>

            </div>

            <div class="clearfix" >
                <hr style="border: 1px solid #efefef">
            </div>

            <div class="minTitle"><span>预约申请信息</span></div>


            <div class="form">
                <ul>
                    <li>
                        <label style="vertical-align: top;">需求描述</label>
                        <textarea id="message" value="" class="taxtarea-haha">
                        </textarea>
                    </li>
                </ul>
            </div>
            <button id="affirm">确认</button>
        </div>
    </div>

</div>

<!--footer-->
<%@include file="/footer.jsp"%>

<script src="js/jquery-1.11.3.js"></script>
<script src="js/common.js"></script>

<style>
.mainList .content .right {
    width: 1157px;
/*     float: right; */
    height: 100%;
    min-height: 1000px;
    padding: 0 20px;
    border: 1px solid #d3d3d3;
}
</style>
</body>

</html>